package com.beijing.http.demo01;

import java.net.InetSocketAddress;

/**
 * @Author Ma Wenqi
 * @Date 2021/3/28 10:15
 * @Version 1.0
 */
public class TestInetSocketAddress {
    public static void main(String[] args) {
        InetSocketAddress inetSocketAddress = new InetSocketAddress("127.0.0.1",8080);
        //  /127.0.0.1:8080
        System.out.println(inetSocketAddress);
        //  127.0.0.1
        System.out.println(inetSocketAddress.getHostName());
        //  8080
        System.out.println(inetSocketAddress.getPort());
        //  127.0.0.1/127.0.0.1
        System.out.println(inetSocketAddress.getAddress());
    }
}